<meta charset="utf-8">
<div class="box box-primary" id="pmpRequires_addModule">
	<form role="form" id="pmpRequires_addModule_editForm" >
		<div class="box-body">
			<div class="form-group">
				<label>模块名称</label> 
				<input type="text" name="name" v-model="pmpRequires.name" class="form-control" id="name" required />
			</div>
			<div class="form-group">
				<label>模块详情</label>
				 <input type="text" name="detail" v-model="pmpRequires.detail" class="form-control" id="detail" required />
			</div>
			<div class="form-group">
				<label>模块顺序</label> 
				<input type="number" name="orderNum" v-model="pmpRequires.orderNum" class="form-control" id="orderNum" required />
			</div>
			<div class="form-group">
				<label>负责人</label> 
				
				<select type="text" name="chargeUserId"
					v-model="pmpRequires.chargeUserId"
					v-kselect="{url:'/pmp/service/ma/pmpCloudMember/loadCloudMemberComboboVo',vmodel:'pmpRequires.chargeUserId',firstEmpty:'true'}"
					class="form-control" id="chargeUserId">
				</select>
			</div>
			<div class="box-footer">
				<button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
				<button type="button" class="btn btn-info pull-right" v-on:click="add">提交</button>
			</div>
		</div>
	</form>
	<script type="text/javascript">
new Vue({
			el : '#pmpRequires_addModule',
			data : {
				pmpRequires : {
					parentId: null,
					chargeUserId : null,
					detail : null,
					parentId : null,
					orderNum : null,
					name : null
				},
				bus : new Vue(),
			},
			mounted : function() {
				var _this=this;
				 _this.pmpRequires.parentId=zfesLayerEditDg.getLayerParam().parentId;
			},
			methods : {
				add : function() {
					if ($("#pmpRequires_addModule_editForm").valid()) {
						var _this = this;
						var url = "/pmp/service/pm/pmpRequires/createModule";
						zfesAjax.ajaxTodo(url, _this.$data.pmpRequires,function(data) {
							
							 var zTree = $.fn.zTree.getZTreeObj("requiresZTree");
							 zTree.reAsyncChildNodes(null,  "refresh", false);
							 setTimeout(function(){ zTree.expandAll(true); }, 1000);
							 
								alertSwal.successText(data.message);
								layer.close(layer.index);
									
									
								})
					}
				},
				cancle : function() {
					layer.close(layer.index);
				}
			}
		});
	</script>
</div>
